<?php
	
//20090210
// IE < 8 = Unsupported
	$AGENT = $_SERVER['HTTP_USER_AGENT'];

  $begin2 = stripos ($AGENT, "(");
  $end2   = stripos ($AGENT, ")");

	$part1  =	substr  ($AGENT, 0 , $begin2-1); 
	$part2  = substr  ($AGENT, $begin2+1 , ($end2-$begin2)-1);
	$part3  = substr  ($AGENT, $end2+1); 
	
	//$SITE_MIDDLE .= "Part1 $part1	<br>Part2 $part2<br>Part3 $part3<br>";

	$AR1 = explode ("/",$part1);
	$AR2 = explode (";",$part2);
	$AR3 = explode (" ",$part3);

// Detect IE version. If less then 8 
	foreach ($AR2 as $str) 
		if (stristr($str,"MSIE")){
			$MSIE = explode (" ",$str);
			if ($MSIE[2] < 8 ) $OLDIE = true;
		}

	include ("3rdparty/osnews/detect.php");
	if ($Browser == "MOBILE") $RENDER_MOBILE = true;
	
	if ($OLDIE) $OLDBROWSER = true;
	if ($OLDBROWSER) $SITE_MIDDLE .= FormatElement(GetLangString($lang,"txt_badbrowser"),GetLangString($lang,"msg_badbrowser"));
	if($_REQUEST['override']=="MOBILE") { $RENDER_MOBILE = true ; $OLDBROWSER = false; }
	if($_REQUEST['override']=="NORMAL") { $RENDER_MOBILE = false; $OLDBROWSER = false; }
	if($_REQUEST['override']=="OLD") 	{ $RENDER_MOBILE = false; $OLDBROWSER = true; }
?>
